<template>
    <div class="w750">
        <div class="submit-order" :class="themes.theme">
            <div class="alert--warning" style="padding: 8px 15px; font-size: 12px" v-if="RefundReturnDetail.payManner == 10">
                您的订单是货到付款，商家同意退款后会联系您退还货款。
            </div>
            <customerService :shopContact.sync="shopContact"></customerService>
            <div class="return-state" v-if="RefundReturnDetail.applyState == -10 || RefundReturnDetail.applyState == 0">
                <div class="state" v-if="RefundReturnDetail.applyState == 0 && RefundReturnDetail.applyType == 1">
                    您已提交退款申请，请等待商家处理
                    <div class="text-999 font font-weight-400">{{ RefundReturnDetail.applyTime | dateformat() }}</div>
                </div>
                <div class="state" v-if="RefundReturnDetail.applyState == 0 && RefundReturnDetail.applyType == 2">
                    您已提交售后申请，请{{ RefundReturnDetail.prodSource == 'JD' ? '耐心等候' : '待商家处理' }}
                    <div class="text-999 font font-weight-400">{{ RefundReturnDetail.applyTime | dateformat() }}</div>
                </div>
                <div class="state cur" v-if="RefundReturnDetail.applyState == -10 && RefundReturnDetail.applyType == 1">
                    商家不同意退款申请, 请您及时处理
                    <div class="text-999 font font-weight-400">{{ RefundReturnDetail.auditTime | dateformat() }}</div>
                </div>
                <div class="state cur" v-if="RefundReturnDetail.applyState == -10 && RefundReturnDetail.applyType == 2">
                    商家不同意售后申请, 请您及时处理
                    <div class="text-999 font font-weight-400">{{ RefundReturnDetail.auditTime | dateformat() }}</div>
                </div>
                <div class="state-des" v-if="RefundReturnDetail.applyState == 0">
                    <!-- 京东商品 -->
                    <template v-if="RefundReturnDetail.prodSource == 'JD'">
                        <div class="des-txt">
                            如有疑问，请致电京东客服热线
                            <a href="tel:4006069068" class="text-primary">4006069068</a>
                            进行咨询
                        </div>
                    </template>
                    <!-- 自营商品 -->
                    <template v-else>
                        <!-- 待商家审核倒计时时间 -->
                        <count-down :time="DownTime" :custom="true" @finish="endcallback">
                            <template v-slot="Timer">
                                <div class="des-txt">
                                    {{ RefundReturnDetail.payManner === 0 ? '您已经成功提交申请, 商家将在' : '若' }}
                                    <span class="rest-time">
                                        <em class="num">{{ Timer.times.days }}</em>
                                        天
                                        <em class="num">{{ Timer.times.hours }}</em>
                                        时
                                        <em class="num">{{ Timer.times.minutes }}</em>
                                        分
                                    </span>
                                    {{ RefundReturnDetail.payManner === 0 ? '钟内处理!' : '' }}
                                </div>
                            </template>
                        </count-down>
                        <div class="des-txt">
                            {{
                                RefundReturnDetail.payManner === 0
                                    ? '若申请被拒绝，您可以尝试修改退款申请或申请客服介入'
                                    : '内申请未处理，退款申请将达成，由商家联系您进行退还货款,若申请被拒绝，您可以尝试修改退款申请或申请客服介入'
                            }}
                        </div>
                    </template>
                </div>
                <div class="state-des" v-if="RefundReturnDetail.applyState == -10">
                    <div class="des-txt" v-if="RefundReturnDetail.prodSource !== 'JD'">该申请已被拒绝，具体请看协商记录</div>
                    <div class="des-txt" v-else>
                        如有疑问，请致电京东客服热线
                        <a href="tel:4006069068" class="text-primary">4006069068</a>
                        进行咨询
                    </div>
                </div>
                <div class="state-btn" v-if="RefundReturnDetail.prodSource !== 'JD'">
                    <div class="btn" @click="serviceChat">客服介入</div>
                    <div class="btn" @click="Candelaction(RefundReturnDetail.refundSn)">取消申请</div>
                    <div class="btn cur" @click="changeApply(RefundReturnDetail.refundId)" v-if="RefundReturnDetail.applyState == -10">修改申请</div>
                </div>
            </div>
            <!-- 已取消 -->
            <div class="return-state" v-if="RefundReturnDetail.applyState == -20">
                <div class="state cur" v-if="RefundReturnDetail.applyType == 1">
                    <span>退款取消</span>
                    <div class="text-999 font font-weight-400">{{ RefundReturnDetail.applyTime | dateformat() }}</div>
                </div>
                <div class="state cur" v-if="RefundReturnDetail.applyType == 2">
                    <span>售后取消</span>
                    <div class="text-999 font font-weight-400">{{ RefundReturnDetail.applyTime | dateformat() }}</div>
                </div>
                <div class="state-des">
                    <div class="des-txt font">取消退款申请后，本次退款申请将关闭，如后续仍有问题，您可再次发起退款申请</div>
                </div>
            </div>
            <!-- 已同意 -->
            <div class="return-state" v-if="RefundReturnDetail.applyState == 40">
                <template>
                    <div class="state cur">
                        <span>
                            {{ RefundReturnDetail.applyType == 1 ? '商家已同意退款申请, 请待商家处理退款' : '商家已同意售后申请, 请待商家处理退款' }}
                        </span>
                        <div class="text-999 font font-weight-400">{{ RefundReturnDetail.auditTime | dateformat() }}</div>
                    </div>
                    <div class="state-des">
                        <count-down :time="DownTime" :custom="true" @finish="endcallback" v-if="RefundReturnDetail.prodSource !== 'JD'">
                            <template v-slot="Timer">
                                <div class="des-txt">
                                    商家将在
                                    <span class="rest-time">
                                        <em class="num">{{ Timer.times.days }}</em>
                                        天
                                        <em class="num">{{ Timer.times.hours }}</em>
                                        时
                                        <em class="num">{{ Timer.times.minutes }}</em>
                                        分
                                    </span>
                                    内处理，如商家逾期未处理则系统自动退款!
                                </div>
                            </template>
                        </count-down>
                        <div class="des-txt" v-else>
                            如有疑问，请致电京东客服热线
                            <a href="tel:4006069068" class="text-primary">4006069068</a>
                            进行咨询
                        </div>
                    </div>
                </template>
                <!-- <div class="state-btn" v-if="RefundReturnDetail.prodSource !== 'JD'">
                    <div class="btn" @click="Candelaction(RefundReturnDetail.refundSn)">取消申请</div>
                </div> -->
            </div>
            <!-- 拒绝收货 -->
            <div class="return-state" v-if="RefundReturnDetail.applyState == 30">
                <div class="state cur">
                    商家拒绝收货, 请您尽快处理
                    <div class="text-999 font font-weight-400">{{ RefundReturnDetail.auditTime | dateformat() }}</div>
                </div>

                <div class="state-des">
                    <count-down :time="DownTime" :custom="true" @finish="endcallback" v-if="RefundReturnDetail.prodSource !== 'JD'">
                        <template v-slot="Timer">
                            <div class="des-txt">
                                您需在
                                <span class="rest-time">
                                    <em class="num">{{ Timer.times.days }}</em>
                                    天
                                    <em class="num">{{ Timer.times.hours }}</em>
                                    时
                                    <em class="num">{{ Timer.times.minutes }}</em>
                                    分
                                </span>
                                内响应，否则本次申请将自动取消!
                            </div>
                        </template>
                    </count-down>
                    <div class="des-txt" v-if="RefundReturnDetail.prodSource !== 'JD'">你可取消申请或修改申请, 也可以联系客服!</div>
                    <div class="des-txt" v-else>
                        如有疑问，请致电京东客服热线
                        <a href="tel:4006069068" class="text-primary">4006069068</a>
                        进行咨询
                    </div>
                </div>
                <div class="state-btn">
                    <template v-if="RefundReturnDetail.prodSource !== 'JD'">
                        <div class="btn" @click="serviceChat(RefundReturnDetail.refundSn, RefundReturnDetail.shopId)">客服介入</div>
                        <div class="btn" @click="Candelaction(RefundReturnDetail.refundSn)">取消申请</div>
                    </template>
                    <div
                        class="btn cur"
                        @click="goLogisticsIfo(RefundReturnDetail.refundSn, RefundReturnDetail.expressName, RefundReturnDetail.expressNo)"
                    >
                        修改物流信息
                    </div>
                </div>
            </div>
            <!-- 待返货 -->
            <div v-if="RefundReturnDetail.applyState == 10">
                <div class="return-state">
                    <div class="state">
                        {{
                            RefundReturnDetail.userReturnGoodsType == 'USER_GOODS'
                                ? '商家已同意售后申请，请您及时退货'
                                : '商家已同意售后申请，待商家上门取件'
                        }}
                        <div class="text-999 font font-weight-400">{{ RefundReturnDetail.auditTime | dateformat() }}</div>
                    </div>
                    <template v-if="RefundReturnDetail.prodSource !== 'JD'">
                        <div class="state-des">
                            <count-down :time="DownTime" :custom="true" @finish="endcallback">
                                <template v-slot="Timer">
                                    <div class="des-txt">
                                        {{ RefundReturnDetail.userReturnGoodsType == 'USER_GOODS' ? '请在' : '商家将在' }}
                                        <span class="rest-time">
                                            <em class="num">{{ Timer.times.days }}</em>
                                            天
                                            <em class="num">{{ Timer.times.hours }}</em>
                                            时
                                            <em class="num">{{ Timer.times.minutes }}</em>
                                            分
                                        </span>
                                        {{
                                            RefundReturnDetail.userReturnGoodsType == 'USER_GOODS'
                                                ? '内填写真实退货物流信息，逾期未填写，退款申请将关闭'
                                                : ' 内上门取件, 如商家逾期未处理, 系统将自动完成退款!'
                                        }}
                                    </div>
                                </template>
                            </count-down>
                            <div class="des-txt" v-if="RefundReturnDetail.userReturnGoodsType == 'USER_GOODS'">
                                未与商家协商，请勿使用到付或平邮，以免商家拒签货物
                            </div>
                        </div>
                    </template>

                    <template v-else>
                        <div class="state-des">
                            <div class="des-txt">
                                <div v-if="RefundReturnDetail.userReturnGoodsType == 'USER_GOODS'">
                                    你的售后申请已通过，退货的邮寄地址，稍后会通过短信的形式发送到你手机上，请您耐心等待
                                </div>
                                <div class="mt-1">
                                    如有疑问，请致电京东客服热线
                                    <a href="tel:4006069068" class="text-primary">4006069068</a>
                                    进行咨询
                                </div>
                            </div>
                        </div>
                    </template>
                    <!-- 上门取件 -->
                    <template v-if="RefundReturnDetail.userReturnGoodsType == 'CALL_COLLECT'">
                        <div class="order-address">
                            <div class="user-info">
                                <em class="item">
                                    取件地址：
                                    <van-icon name="location-o" class="icon" :color="themes.color" />
                                    {{ RefundReturnDetail.userContactsName }}
                                </em>
                                <em class="item">{{ RefundReturnDetail.userContactsPhone }}</em>
                            </div>
                            <div class="address-det" style="margin-left: 80px">
                                {{ RefundReturnDetail.fetchDetailedAddress }}
                            </div>
                        </div>
                    </template>
                    <!-- 自行寄回 -->
                    <template v-else>
                        <div class="order-address" v-if="RefundReturnDetail.prodSource !== 'JD'">
                            <div class="user-info">
                                <em class="item">
                                    退货地址:
                                    <van-icon name="location-o" class="icon" :color="themes.color" />
                                    {{ RefundReturnDetail.returnGoodsContacts }}
                                </em>
                                <em class="item">{{ RefundReturnDetail.returnGoodsPhone }}</em>
                            </div>
                            <div class="address-det" style="margin-left: 80px">
                                {{ RefundReturnDetail.returnGoodsAddress }}
                            </div>
                        </div>
                    </template>

                    <div class="state-btn">
                        <div class="btn" @click="Candelaction(RefundReturnDetail.refundSn)" v-if="RefundReturnDetail.prodSource !== 'JD'">
                            取消申请
                        </div>
                        <div
                            v-if="RefundReturnDetail.userReturnGoodsType == 'USER_GOODS'"
                            class="btn cur"
                            @click="goLogisticsIfo(RefundReturnDetail.refundSn)"
                        >
                            填写物流信息
                        </div>
                    </div>
                </div>
            </div>
            <!-- 待收货 -->
            <div class="return-state" v-if="RefundReturnDetail.applyState == 20">
                <div class="state">
                    货品已退给商家，等待商家确认收货
                    <div class="text-999 font font-weight-400">{{ RefundReturnDetail.applyTime | dateformat() }}</div>
                </div>
                <div class="state-des">
                    <template v-if="RefundReturnDetail.prodSource !== 'JD'">
                        <count-down :time="DownTime" :custom="true" @finish="endcallback">
                            <template v-slot="Timer">
                                <div class="des-txt">
                                    若
                                    <span class="rest-time">
                                        <em class="num">{{ Timer.times.days }}</em>
                                        天
                                        <em class="num">{{ Timer.times.hours }}</em>
                                        时
                                        <em class="num">{{ Timer.times.minutes }}</em>
                                        分
                                    </span>
                                    内申请未处理，退款申请将达成，并退款至您的付款账户中
                                </div>
                            </template>
                        </count-down>
                        <div class="des-txt">若申请被拒绝，您可以尝试修改退款申请或申请客服介入</div>
                        <div class="state-btn">
                            <div class="btn" @click="serviceChat">客服介入</div>
                            <div class="btn" @click="Candelaction(RefundReturnDetail.refundSn)">取消申请</div>
                        </div>
                    </template>
                    <template v-else>
                        <div class="des-txt">
                            如有疑问，请致电京东客服热线
                            <a href="tel:4006069068" class="text-primary">4006069068</a>
                            进行咨询
                        </div>
                    </template>
                </div>
            </div>
            <!-- 待买家收货 -->
            <div class="return-state" v-if="RefundReturnDetail.applyState == 50">
                <div class="state">
                    商家已返货，请您耐心等候
                    <div class="text-999 font font-weight-400">{{ RefundReturnDetail.countdownTime | dateformat() }}</div>
                </div>
                <div class="state-des">
                    <!-- <count-down :time="DownTime" :custom="true" @finish="endcallback">
                        <template v-slot="Timer">
                            <div class="des-txt">
                                若
                                <span class="rest-time">
                                    <em class="num">{{ Timer.times.days }}</em>
                                    天
                                    <em class="num">{{ Timer.times.hours }}</em>
                                    时
                                    <em class="num">{{ Timer.times.minutes }}</em>
                                    分
                                </span>
                                内申请未处理，退款申请将达成，并退款至您的付款账户中
                            </div>
                        </template>
                    </count-down> -->
                    <!-- <div class="des-txt">若此过程中遇到问题，您可以取消申请或申请客服介入</div> -->
                    <div class="state-btn" v-if="RefundReturnDetail.prodSource !== 'JD'">
                        <div class="btn" @click="Candelaction(RefundReturnDetail.refundSn)">取消申请</div>
                    </div>
                </div>
            </div>
            <!-- 已完成 -->
            <div class="return-state" v-if="RefundReturnDetail.applyState == 60">
                <div class="state">
                    {{ RefundReturnDetail.applyType == 1 ? '您订单已退款成功' : '您的订单已退货退款成功' }}
                    <div class="text-999 font font-weight-400">{{ RefundReturnDetail.finishTime | dateformat() }}</div>
                </div>
            </div>
            <!-- 详情 -->
            <div class="submit-list" v-if="RefundReturnDetail.applyState == 20 || RefundReturnDetail.applyState == 30">
                <div class="submit-con">
                    <div class="order-style">
                        <div class="left">退款金额</div>
                        <div class="right">
                            <div class="return-price price">￥{{ RefundReturnDetail.refundAmount }}</div>
                        </div>
                    </div>
                </div>
            </div>
            <!-- TODO先屏蔽 -->
            <!-- <div class="return-step" v-if="RefundReturnDetail.applyState == 20 || RefundReturnDetail.applyState == 30">
                <div class="step-item cur">
                    <div class="s-num"></div>
                    <div class="s-text">商家同意售后</div>
                    <div class="text-999 font font-weight-400">{{ RefundReturnDetail.auditTime | dateformat() }}</div>
                </div>
                <div
                    class="step-item"
                    :class="
                        (RefundReturnDetail.applyState == 2 && RefundReturnDetail.refundProgress == 1) || RefundReturnDetail.applyState == 3
                            ? 'cur'
                            : 'error'
                    "
                >
                    <div class="s-num"></div>
                    <div class="s-text">银行受理</div>
                </div>
                <div class="step-item" :class="RefundReturnDetail.applyState == 3 ? 'cur' : 'error'">
                    <div class="s-num"></div>
                    <div class="s-text">退款成功</div>
                    <div class="s-time">预计1-7工作日</div>
                </div>
            </div> -->
            <!-- 协商记录 -->

            <div class="submit-list">
                <div class="submit-con d-flex j-sb" @click="goConsult">
                    <div class="file-txt">查看协商记录</div>
                    <i class="arr" style="margin-top: 14px; width: 10px; height: 10px">
                        <img src="../../../assets/images/arrow.png" alt="" />
                    </i>
                </div>
                <div class="submit-con">
                    <div class="order-style">
                        <span class="left">申请单信息</span>
                    </div>
                    <div class="pro-mes" v-if="RefundReturnDetail.subItemId != 0" @click="gogoodsDet(RefundReturnDetail.productId)">
                        <div class="pro-img">
                            <legend-image :pic="RefundReturnDetail.productImage" alt="" :isJD="RefundReturnDetail.prodSource == 'JD'" />
                            <img
                                src="@/assets/images/haitao-small.png"
                                class="haitao"
                                v-if="RefundReturnDetail.specialOrderType == 'OVERSEAS_ORDER'"
                            />
                        </div>
                        <div class="pro-name">
                            <a href="#" class="name">{{ RefundReturnDetail.productName }}</a>
                            <div class="sku">
                                {{ RefundReturnDetail.skuName }}
								<!-- serviceType 1 退款 2退款退货 3换货 4维修") -->
                                <span v-if="RefundReturnDetail.serviceType != 1" class="goods-num">数量：{{ RefundReturnDetail.goodsNum }}</span>
                            </div>
                            <div class="goods-btn clearfix">
                                <span class="price">
                                    <em class="now">￥{{ RefundReturnDetail.price }}</em>
                                </span>
                            </div>
                        </div>
                    </div>
                    <div class="return-msg">
                        <div class="item">
                            <span class="item-txt">服务类型：{{ RefundReturnDetail.serviceType == 1 ? '仅退款' : '退款退货' }}</span>
                        </div>
                        <div class="item">
                            <span class="item-txt">申请原因：{{ RefundReturnDetail.buyerMessage ? RefundReturnDetail.buyerMessage : '暂无' }}</span>
                        </div>
                        <div class="item" v-if="RefundReturnDetail.serviceType == 2">
                            <span class="item-txt">
                                返货方式：{{ RefundReturnDetail.userReturnGoodsType == 'USER_GOODS' ? '自行寄回' : '上门取件' }}
                            </span>
                        </div>
                        <div class="item">
                            <span class="item-txt">申请金额：￥{{ RefundReturnDetail.applyRefundAmount }}</span>
                        </div>
                        <div class="item">
                            <span class="item-txt">
                                退款金额：￥{{ RefundReturnDetail.refundAmount }}
                                <span v-if="RefundReturnDetail.applyType == 1">(含运费{{ RefundReturnDetail.freightAmount }}元)</span>
                            </span>
                        </div>
                        <div class="item" v-if="RefundReturnDetail.goodsNum">
                            <span class="item-txt">退货数量：{{ RefundReturnDetail.goodsNum }}</span>
                        </div>

                        <div class="item">
                            <span class="item-txt">申请时间：{{ RefundReturnDetail.applyTime | dateformat('YYYY-MM-DD HH:mm:ss') }}</span>
                        </div>
                        <div class="item">
                            <span class="item-txt">申请编号：{{ RefundReturnDetail.refundSn }}</span>
                            <span
                                class="item-a"
                                v-clipboard:copy="RefundReturnDetail.refundSn"
                                v-clipboard:success="onCopy"
                                v-clipboard:error="onError"
                            >
                                复制
                            </span>
                        </div>
                        <div class="item">
                            <span class="item-txt">订单编号：{{ RefundReturnDetail.subNumber }}</span>
                            <span class="item-a" @click="enterOrderDetail(RefundReturnDetail.subNumber)">查看</span>
                        </div>
                        <div class="item">
                            <span class="item-txt">申请说明：{{ RefundReturnDetail.applyRemark ? RefundReturnDetail.applyRemark : '暂无' }}</span>
                        </div>
                    </div>
                </div>
                <div class="submit-con d-flex mb-2">
                    <div class="file-txt">上传凭证：</div>
                    <template v-if="RefundReturnDetail.photoFiles && RefundReturnDetail.photoFiles.length > 0">
                        <div class="file-img" style="width: 200px">
                            <span class="add-img" @click="imagePreview(item)" v-for="(item, index) in RefundReturnDetail.photoFiles" :key="index">
                                <img :src="$imgUrlHead + item" alt="" />
                            </span>
                        </div>
                    </template>

                    <div class="font text-999 file-txt mb-2" v-else>无</div>
                </div>
            </div>
        </div>
    </div>
</template>

<script>
import countDown from 'components/countdown/count-down'
import customerService from 'components/customerService/customerService'
import legendImage from 'components/legendImage/legendImage'
import { afterSale } from 'api/afterSale'
import { mapState } from 'vuex'
import { subRefundReturnDetail, candelAction } from 'api/refunds'
import { ImagePreview } from 'vant'
import cash from 'utils/tool'
export default {
    data() {
        return {
            active: 1,
            Money: cash, //价格转换
            RefundReturnDetail: {
                photoFiles: []
            },
            DownTime: '',
            picPreview: '', //图片预览
            shopContact: false
        }
    },
    mounted() {
        let that = this
        let refundId = this.$route.query.refundId
        this.getReturnDetail(refundId)
    },
    beforeRouteLeave(to, from, next) {
        if (!this.picPreview) {
            next()
        } else {
            next(false)
            this.picPreview.close()
            this.picPreview = ''
        }
    },
    destroyed() {},
    methods: {
        goback() {
            this.$router.back()
            this.$router.isBack = true
        },
        //初始化数据
        getReturnDetail(refundId) {
            subRefundReturnDetail({
                refundId: refundId
            }).then((res) => {
                if (res.status == 1) {
                    if (res.result) {
                        this.RefundReturnDetail = res.result
                        // 待商家审核倒计时时间
                        this.DownTime = res.result.countdownTime
                    }
                } else {
                }
            })
        },
        // 去协商记录
        goConsult() {
            this.$router.push({
                path: `/consultRecords`,
                query: {
                    refundSn: this.RefundReturnDetail.refundSn
                }
            })
        },
        //填写\修改物流
        goLogisticsIfo(refundSn, name, num) {
            //编辑
            if (name) {
                this.$router.push({
                    path: `/logisticsIfo`,
                    query: {
                        refundSn: refundSn,
                        expressName: name,
                        expressNo: num
                    }
                })
            } else {
                //填写
                this.$router.push({
                    path: `/logisticsIfo`,
                    query: {
                        refundSn: refundSn
                    }
                })
            }
        },
        changeApply(refundId) {
            this.$router.push({
                path: `/updataApplyReturn`,
                query: {
                    refundId: refundId
                }
            })
        },
        //撤销申请
        Candelaction(refundSn) {
            let that = this
            this.$dialog
                .confirm({
                    title: '是否撤销申请',
                    message: '请您再三考虑哦~~~'
                })
                .then(() => {
                    afterSale.applyCancel({ refundSn: refundSn }).then((res) => {
                        if (res.status == 1) {
                            this.$toast({
                                message: '撤销成功',
                                duration: 1000
                            })
                            that.getReturnDetail(this.$route.query.refundId)
                        } else {
                            this.$toast({
                                message: res.msg,
                                duration: 1000
                            })
                        }
                    })
                })
                .catch(() => {
                    // on cancel
                })
        },
        //图片预览
        imagePreview(pic) {
            let arrPic = []
            arrPic.push(this.$imgUrlHead + pic)
            this.picPreview = ImagePreview({
                images: arrPic,
                showIndex: false,
                onClose() {
                    // do something
                }
            })
        },
        //去商品详情
        gogoodsDet(goodsInfoId) {
            this.$router.push({
                path: `/goodsDetail`,
                query: {
                    goodsInfoId: goodsInfoId
                }
            })
        },
        //复制
        onCopy() {
            this.$toast.success({
                message: '内容已复制',
                duration: 1000
            })
        },
        onError() {
            this.$toast.fail({
                message: '内复制失败',
                duration: 1000
            })
        },
        //关闭图片预览
        closePic() {
            if (this.picPreview) {
                this.picPreview.close()
                return
            } else {
                this.goback()
            }
        },
        //查看订单详情
        enterOrderDetail(subNumber) {
            this.$router.push({
                path: `/orderDetail`,
                query: {
                    subNumber: subNumber
                }
            })
        },
        //客服介入
        serviceChat() {
            this.shopContact = true
            // this.$router.push({
            //     path: `/serviceChat`,
            //     query: {
            //         consultId: refundSn,
            //         consultType: 'refund',
            //         shopId: shopId
            //     }
            // })
        },
        //事件到了
        endcallback() {
            this.getReturnDetail(this.$route.query.refundId)
        }
    },
    computed: {
        ...mapState(['themes']),
        goodsNum() {
            let str = '' + this.goodsNum
            if (str.indexOf('.') != -1) {
                let arr = str.split('')
                arr.splice(arr.length - 1)
                let str2 = arr.join('')
                this.goodsNum = +str2
            }
            return this.goodsNum
        }
    },
    components: {
        countDown,
        customerService,
        legendImage
    }
}
</script>

<style src="../../../assets/css/style/submit-order-style.css" scoped></style>
<style src="../../../assets/css/submit-order.css" scoped></style>
<style src="../../../assets/css/return.css" scoped></style>
<style scoped>
.pro-name {
    width: 75%;
}
.return-msg .item .item-txt {
    max-height: 24px;
    overflow: hidden;
    line-height: 24px;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    text-overflow: ellipsis;
    word-break: break-all;
}

.return-step .step-item.error .s-num::after {
    background: #ccc;
}
.return-step .step-item:nth-child(2).error .s-num::before {
    background-color: #ccc;
}
.return-step .step-item:last-child.error .s-num::before {
    background-color: #ccc;
}
.icon {
    vertical-align: middle;
    padding: 0 0.08rem 0.08rem 0;
}
</style>
